home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11522 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Determining the length of an int in string form
  5. Date: Sun, 24 Mar 96 21:31:50 GMT
  6. Organization: none
  7. Message-ID: <827703110snz@genesis.demon.co.uk>
  8. References: <3146D058.DD7@cbm.com> <4i7uth$qph@inet-nntp-gw-1.us.oracle.com> <DoE38u.GIH@iquest.net> <DoGs5D.FFB@iquest.net> <4ipd9k$ep8@news.erinet.com> <Pine.SOL.3.91.960320230310.14476C-100000@darwin.UCSC.EDU> <Pine.SOL.3.91.960321120638.3532A-100000@darwin.UCSC.EDU>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <Pine.SOL.3.91.960321120638.3532A-100000@darwin.UCSC.EDU>
  15.            royaltey@darwin.UCSC.EDU "Hal Royaltey" writes:
  16.  
  17. >  Another alternative is to sprintf the string into a static buffer
  18. >known to be long enough to hold any int, strlen the result to find the
  19. >actual length,
  20.  
  21. Know your standard library - sprintf has a return value which is the length
  22. of the string it wrote.
  23.  
  24. -- 
  25. -----------------------------------------
  26. Lawrence Kirby | fred@genesis.demon.co.uk
  27. Wilts, England | 70734.126@compuserve.com
  28. -----------------------------------------
  29.